home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-03-19 | 3.1 KB | 80 lines | [TEXT/MPS ] |
- (*
- * File: ThreadedVUTool.vulib
- *
- * Contains: The tool definition along with the high level tasks to access
- * the tool's services
- *
- *
- * Written by: SBR from FileTool by P. Nagarajan
- *
- * Copyright: © 1992-1997 by Apple Computer, Inc., all rights reserved.
- *
- * Change History (most recent first):
- *
- * <1.3> 01/24/97 JAS Added common XTool services (Initialize, etc.)
- * <1.2> 06/24/96 SBR Added TestSleepTicks, ThreadStatus, FreeMemory.
- * <1.1> 02/07/95 SBR Synchronize with HLQ Automation.
- * 10/30/94 SBR Built with Echo service
- * 03/26/93 NAGA xxx put comment here xxx
- *
- * To Do:
- *)
-
- tool ThreadedVUTool s:'vu21'
- begin
- # Services specific to ThreadedVUTool:
-
- # To Echo a list after a number of ticks, in a new thread
- Service "EchoThread"( 'undefined', 'integer', 'symbol', 'integer' ) return 'undefined';
- # first parameter is the value or list of values to echo
- # second parameter is the number of ticks to pause before returning
- # third parameter is Boolean:
- # true means beep entering and leaving ProcessRequest()
- # false means do not
- # fourth parameter is integer n:
- # non-zero means beep after every n loops waiting for the cancel
- # zero means do not beep while looping
- # return value should be equal to first parameter except when:
- # symbol and descriptor parameters are turned into strings by VU
- # integers are sent to the tool as long or short based on VU version
- # longs are sent to the script as long or string based on VU version
-
- # To Echo a list after a number of ticks, in the RequestDispatcher thread
- Service "EchoNoThread"( 'undefined', 'integer', 'symbol', 'integer' ) return 'undefined';
- # same as Echo service except this one is non-threaded
-
- # To set the number of ticks given to WaitNextEvent() in the tool
- # Only affects the tool when it is in the background
- # returns the previous value
- Service "SetSleepTicks"( 'integer' ) return 'integer';
- # first parameter is put into the WaitNextEvent() sleep parameter
-
- # Test the effects of SetSleepTicks using a non-threaded loop
- # SetSleepTicks only affects the tool when it is in the background
- # Call with async:true, or, set ExternalToolTimeout to 5 + first parameter
- # returns the average number of times it looped per second
- Service "TestSleepTicks"( 'integer' ) return 'integer';
- # first parameter is the number of seconds to loop calling CheckForCancel
-
- # To get the status of the threaded service support
- # Use this to determine if threaded services in general are available
- # returns "Enabled", "Disabled", "Unavailable"
- Service "ThreadStatus"( ) return 'undefined';
-
- # To get the amount of Free Memory in the tool's heap
- # Comes from FreeMem() OS Memory Manager call, use for finding memory leaks
- # returns a long integer
- Service "FreeMemory"( ) return 'integer';
-
-
- # Services common to all Virtual User external tools:
-
- Service "Initialize"( 'symbol' ); # pass TRUE for target, FALSE for host
- Service "Cancel"( 'string' );
- Service "GetToolServices"() return 'list';
- Service "GetToolVersion"() return 'list';
- Service "Poll"( 'string' ) return 'list';
- Service "ServiceSupported"( 'string' ) return 'symbol';
- Service "Quit"();
-
- end;